package com.myfum.wingplayer.utils
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.filesystem.File;
	import flash.filesystem.FileMode;
	import flash.filesystem.FileStream;
	
	public class ReportManager extends EventDispatcher
	{
		public function ReportManager(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		/**
		 * append log to report file
		 */
		public static function log(value:String):void{
			/*var file:File = File.applicationStorageDirectory;
			file = file.resolvePath(getFilePath(regionId));
			var fs:FileStream = new FileStream();
			fs.open(file, FileMode.APPEND);
			fs.writeUTFBytes("\n" + getTime() + value);
			fs.close();*/
		}
		
		private static function getFilePath(id:int):String{
			var now:Date = new Date();
			return now.fullYear+"/"+now.month+"/"+now.day+"/report_"+now.hours+"_"+id+".log";
		}
		
		private static function getTime():String{
			var now:Date = new Date();
			return "["+now.hours+":"+now.minutes+":"+now.seconds+"."+now.milliseconds+"]";
		}
	}
}